package NetEase;

import java.util.Scanner;

/**
 * @author zhangmin
 * @create 2022-03-27 10:15
 * 从前向后记录有多少相邻的0，从后向前也是
 */
public class 网易_2021_2 {
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        int n=line.length;
        if (n==2){
            System.out.println(1);
            return;
        }
        int[] left=new int[n],right=new int[n];
        left[0]=line[0].equals("0")?1:0;
        right[n-1]=line[n-1].equals("0")?1:0;
        for (int i = 1; i < n; i++) {
            left[i]=line[i].equals("0")?(left[i-1]+1):0;
            right[n-i-1]=line[n-i-1].equals("0")?(right[n-i]+1):0;
        }
        long res=1;
        for (int i = 0; i < n; i++) {
            res=Math.max(res,Math.min(left[i],right[i]));
        }
        System.out.println(res);
    }
}
